package cn.edu.xmu.oomall.aftersale.microservice;

import cn.edu.xmu.oomall.aftersale.microservice.vo.SimpleOrderItemVo;
import cn.edu.xmu.oomall.aftersale.microservice.vo.SimplePaymentVo;
import cn.edu.xmu.oomall.core.util.ReturnObject;
import cn.edu.xmu.privilegegateway.annotation.util.InternalReturnObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author X-Raymond
 * @date 2021/12/8
 */
@FeignClient(name = "order-service")
public interface OrderService {
    /**
     * 根据id获得orderItem
     *
     * @param orderItemId
     * @return TODO:尚未与订单模块进行集成测试
     */
    @GetMapping(value = "/internal/orderitems/{id}")
    InternalReturnObject<SimpleOrderItemVo> getSimpleOrderItemById(@PathVariable(value = "id") Long orderItemId);

    /**
     * 获取订单的支付信息
     *
     * @param id
     * @return
     */
    @GetMapping(value = "/orders/{id}/payment")
    InternalReturnObject<SimplePaymentVo> getPaymentByOrderId(@PathVariable(value = "id") Long id);
}
